package edu.jkd.config;

import com.qiniu.storage.UploadManager;
import com.qiniu.util.Auth;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UploadConfig {
    @Value("${qiniu.accessKey}")
    private static String accessKey;
    @Value("${qiniu.secretKey}")
    private static String secretKey;

    public static Auth getAuth() {
        System.out.println("注入Auth***********");
        Auth auth = Auth.create("XZQayXgGa9URAV57gXIesC-_lkoXjS3QCjbTGSZ8", "g4Vn6-PmFMprY1k2QGifaaYhHlKYm8kQJzGZocjE");
        System.out.println();
        return auth;
    }

    public static UploadManager getUploadManager() {
        return new UploadManager(new com.qiniu.storage.Configuration());
    }
}
